package com.qf.lanzhou.blog.api.service.impl;

import com.qf.lanzhou.blog.api.dao.AuditDao;
import com.qf.lanzhou.blog.api.dao.Impl.login.AuditDaoImpl;
import com.qf.lanzhou.blog.api.service.CommitReportCommentService;

/**
 * @author 是柠檬甜
 * @ClassName checkReportCommentServiceImpl
 * @description 审核举报评论服务层实现类
 * @date 2020/12/21 11:37
 * @modifier 是柠檬甜
 * @date 2020-12-21 11:37
 * @Version V1.0
 */
public class CommitReportCommentServiceImpl implements CommitReportCommentService {
    private AuditDao auditDao=new AuditDaoImpl();
    @Override
    public String addAuditReportComment(Long commentId) {

        if (!auditDao.selectAuditByCommentId(commentId)){
            throw new RuntimeException("已提交，等待审核~");
        }
        if (!auditDao.saveAuditReportComment(commentId)){
            System.out.println(auditDao.saveAuditReportComment(commentId));
            throw new RuntimeException("系统繁忙，请重试");
        }
        return "举报提交成功，等待管理员审核~";
    }
}
